package com.durian.base.permission.task;

import android.content.Context;
import androidx.annotation.Nullable;

import com.durian.base.permission.task.IPermissionTask;
import com.durian.base.permission.xx.XXPermissions;
import com.durian.base.utils.StringUtils;

public abstract class AbsPermissionTask implements IPermissionTask {
    @Override
    public boolean hasPermission(Context context) {
        return XXPermissions.hasPermission(context, permissionGroup());
    }

    @Override
    public boolean equals(@Nullable Object obj) {
        if (obj == null){
            return false;
        }
        return StringUtils.isEqualsIgnoreCase(obj.getClass().getName(), getClass().getName());
    }
}
